def success(data=None, msg="Success"):
    return {"code": 200, "msg": msg, "data": data}

def error(msg="Error", code=100):
    return {"code": code, "msg": msg}, 200

def pagination(items, total, msg="Success", code=200):
    """返回分页数据结构"""
    return {
            "data":{
                "items": items,
                "total": total
            },
            "message": msg,
            "code": code
        }
